1857.1.1 = {
  capital = 608
  
	set_country_flag = true_china
	set_country_flag = QNG_xianjing_tree
	set_country_flag = xianfeng_universal_prosperity_flag
	set_country_flag = summer_palace_flag
	QNG = { country_event = { id = qing.29 days = 7} }

	oob = "QNG_1857"
	set_naval_oob = "QNG_mtg_naval"

	### Economy
    add_ideas = generic_unemployment_idea
    set_variable = { unemployment_value_modifier = 0.1 }
    set_variable = { current_unemployment = 0.05 }
    clamp_variable = {
        var = current_unemployment
        min = 0
        max = 1
    }
    update_unemployment_modifier = yes
    add_to_variable = { money = 14 }
	set_variable = { current_loans_sum = 2 }

  	set_convoys = 30
  
  	set_research_slots = 2
  	add_ideas = { 
		#POLITICS 
			
		#hos_is_leader
		pre_industrial_era
		agrarian
		#no_heir
		#absolute_monarchy
		law_pre_industrial_army_chinese

		civilian_economy
		limited_exports
		army_spending_level_2
		taxation_level_1
		cl_legal

		#stagnation_growth
		border_control
		limited_conscription
		slavery
		absolutism

		#no_constitution
		no_elections
		#religion_confucian
		privileged_education
    	state_religion

     	social_spending_level_1
    	law_spending_level_3
   		road_spending_level_1
   		navy_spending_level_1
   	 	research_spending_level_1

        #NATIONAL SPIRITS
		QNG_idea_arrow_incident
		QNG_idea_banner_armies
		QNG_outdated_army
		QNG_idea_opium_crissis
		QNG_idea_han_nationalism
		QNG_idea_devastation_first_opium_war
		QNG_idea_corutpion1
 	}
  
    #Rivals 
    set_variable = { rival_country = RUS.id }
	#Most Favoured Country  
    set_variable = { most_favoured_country = KOR.id }
	
  	#Diplomacy

  	set_politics = {
	 	ruling_party = autocracy
	}

QNG = {
	set_autonomy = {
		target = PAW
		autonomous_state = autonomy_protectorate
		freedom_level = 0.35
	}
}



QNG = { set_country_flag = Oceania_industrializing }
#activate_mission = QNG_PTH_yunnan_peace

set_popularities = {
    anarchism = 0
    ideology_social_liberalism = 0
    ideology_radical_socialism = 0
    social_egalitarianism = 0
    centrism = 0
    traditional_conservatism = 0
    radical_democracy = 0
    chauvinist_populism = 0
    autocracy = 100
    fundamentalism = 0
}

	#Balance of Power
	set_power_balance = {
		id = QNG_Balance_of_Power_Qing_Establishment
		left_side = QNG_conservative_side
		right_side = QNG_yangwu_side
		set_value = 0
	}

  
  add_opinion_modifier = { target = USA modifier = eoanb_om_USA_QNG_opium_neutral }
  add_opinion_modifier = { target = ENG modifier = eoanb_om_ENG_QNG_arrow_incident }
  reverse_add_opinion_modifier = { target = ENG modifier = eoanb_om_ENG_QNG_arrow_incident }

  set_technology = {
	traditional_mixed_arms = 1
	#infantry_weapons = 1 
	tribal_carrier_birds=1 
	tribal_electrical_theory=1
	tribal_steel_tools=1
	tribal_tatics=1
	tribal_gunpowder=1
	tribal_riding=1
	tribal_steam_experiments=1
	tribal_forging=1
	tribal_artisan=1
	tribal_chemistry=1
	tribal_guilds_trade=1
	tribal_crop_planting=1
	tribal_irrigation=1
	tribal_crop_rotation=1
	tribal_salted_smoked_goods=1
	tribal_leching=1
	tech_naval_early_gunboat = 1
	tech_naval_1850_gunboat = 1
	tech_infantry_napoleonic_uniform = 1
	tech_naval_corvette = 1
    tech_naval_mtg_24_pounder_battery = 1
    tech_naval_mtg_sails = 1
    tech_naval_mtg_crows_nest = 1
	start_build_tech = 1
	gw_artillery = 1
	basic_cavalry = 1
	dry_puddling_process = 1
	bessemer_process = 1
	tech_naval_capital_ship_naval_transportation = 1
	tech_naval_mtg_primitive_sailing_boat_early= 1
	tech_naval_mtg_primitive_sailing_boat_mid= 1
	tech_naval_mtg_primitive_sailing_boat_late= 1
	tech_naval_mtg_primitive_naval_technology=1
	tech_naval_early_gunboat = 1
	tech_naval_1850_gunboat = 1
  }
	add_equipment_to_stockpile = { type = infantry_equipment_pike_and_shot_0 amount = 120000 producer = QNG }
	add_equipment_to_stockpile = { type = uniform_equipment_0 amount = 120000 producer = QNG }
	add_equipment_to_stockpile = { type = infantry_equipment_rifle_0 amount = 50000 producer = ENG }
	add_equipment_to_stockpile = { type = cavalry_equipment_0 amount = 30000 producer = QNG }
	add_equipment_to_stockpile = { type = cannon_equipment_0 amount = 50 producer = QNG }
	
	create_equipment_variant = {
		name = "Chinese Junk class"
		type = ship_hull_primitive_sailing_boat_2
		name_group = GER_CA_HISTORICAL
		parent_version = 0
			modules = {
				fixed_ship_battery_slot = ship_cannon_battery_0
				#fixed_ship_fire_control_system_slot = empty
				fixed_ship_engine_slot = ship_engine_primitive_sails_0
				#fixed_ship_armor_slot = empty
				mid_1_custom_slot = empty
				#front_1_custom_slot = empty
			}
	}
	create_equipment_variant = {
		name = "Confucius-class"
		type = ship_hull_gunboat_1
		name_group = GER_CA_HISTORICAL
		parent_version = 0
		modules={
			fixed_ship_battery_slot=ship_cannon_battery_1
			fixed_ship_engine_slot=ship_engine_steam_screw_gunboat
			fixed_ship_fire_control_system_slot=fire_control_system_0
			mid_1_custom_slot=ship_cannon_battery_1
			fixed_ship_armor_slot=ship_armor_capital_hardwood_0
		}
	}


  # POLITICAL LEADERS
	recruit_character = QNG_Xianfeng_Emperor
	recruit_character = QNG_Sengge_Rinchen
	recruit_character = QNG_Feng_Zicai
	recruit_character = QNG_Zuo_Zongtang
	recruit_character = QNG_Nie_Shicheng
	recruit_character = QNG_Song_Qing
	recruit_character = QNG_Zhang_Shusheng
	recruit_character = QNG_Cixi_Empress
	recruit_character = QNG_great_regency_council
	recruit_character = QNG_Tongzhi_Emperor
	recruit_character = QNG_Guangxu_Emperor
	recruit_character = QNG_Zeng_Guofan
	recruit_character = QNG_ronglu
	recruit_character = QNG_zhu_hongzhang
	recruit_character = QNG_bao_chao
	recruit_character = QNG_guanwen
	recruit_character = QNG_luo_bingzhang
	recruit_character = QNG_zhang_guoliang
	recruit_character = QNG_He_Chun
	recruit_character = QNG_Peng_Yulin
	recruit_character = QNG_Peng_Yulin_Admiral
	
	#Advisors
	recruit_character = QNG_weng_tonghe
	recruit_character = QNG_yixuan_princ_chun #yixuan was 17 but eh let's allow him to stay
	#recruit_character = QNG_duan yixuan was literally 1 year old in 1857
	recruit_character = QNG_shushun
	recruit_character = QNG_prince_gong
	recruit_character = QNG_prosper_giquel
	recruit_character = QNG_john_fryer
	recruit_character = QNG_cixi 

	
	#Theorists
	recruit_character = QNG_li_hongzhang

}

1870.5.19 = {
  capital = 608
  
  set_country_flag = true_china
  set_country_flag = QNG_xianjing_tree

  oob = "QNG_1857"

  set_convoys = 30
  
  unlock_national_focus = QNG_focus_self_strenthening_movement

  set_research_slots = 3
  add_ideas = { 
    #POLITICS 
		  
    #hos_is_leader
    pre_industrial_era
    agrarian
    #no_heir
    #absolute_monarchy
	law_pre_industrial_army_chinese

    civilian_economy
    limited_exports
    army_spending_level_2
    taxation_level_1
	cl_legal

    #stagnation_growth
    border_control
	limited_conscription
    slavery
    absolutism

    #no_constitution
    no_elections
	#religion_confucian
    privileged_education
    state_religion

    social_spending_level_1
    law_spending_level_4
    road_spending_level_1
    navy_spending_level_1
    research_spending_level_1

    #NATIONAL SPIRITS
	QNG_idea_arrow_incident
	QNG_idea_banner_armies
	QNG_outdated_army
  	}
  
    #Rivals 
    set_variable = { rival_country = RUS.id }
	#Most Favoured Country  
    set_variable = { most_favoured_country = KOR.id }
	
  	#Diplomacy

  	set_politics = {
	  ruling_party = autocracy
	}

	QNG = { set_country_flag = Oceania_industrializing }
	#activate_mission = 

	set_popularities = {
		anarchism = 0
		ideology_social_liberalism = 0
		ideology_radical_socialism = 0
		social_egalitarianism = 0
		centrism = 0
		traditional_conservatism = 0
		radical_democracy = 0
		chauvinist_populism = 0
		autocracy = 100
		fundamentalism = 0
	}
  
  add_opinion_modifier = { target = USA modifier = eoanb_om_USA_QNG_opium_neutral }
  add_opinion_modifier = { target = ENG modifier = eoanb_om_ENG_QNG_arrow_incident }
  reverse_add_opinion_modifier = { target = ENG modifier = eoanb_om_ENG_QNG_arrow_incident }

  set_technology = {
	traditional_mixed_arms = 1
	#infantry_weapons = 1 
	tribal_carrier_birds=1 
	tribal_electrical_theory=1
	tribal_steel_tools=1
	tribal_tatics=1
	tribal_gunpowder=1
	tribal_riding=1
	tribal_steam_experiments=1
	tribal_forging=1
	tribal_artisan=1
	tribal_chemistry=1
	tribal_guilds_trade=1
	tribal_crop_planting=1
	tribal_irrigation=1
	tribal_crop_rotation=1
	tribal_salted_smoked_goods=1
	tribal_leching=1
	gw_artillery = 1
	tech_infantry_napoleonic_uniform = 1
	tech_naval_corvette = 1
    tech_naval_mtg_24_pounder_battery = 1
    tech_naval_mtg_sails = 1
    tech_naval_mtg_crows_nest = 1
	start_build_tech = 1
	basic_cavalry = 1
	dry_puddling_process = 1
	bessemer_process = 1
	tech_naval_capital_ship_naval_transportation = 1
	tech_naval_mtg_primitive_sailing_boat_early= 1
	tech_naval_mtg_primitive_sailing_boat_mid= 1
	tech_naval_mtg_primitive_sailing_boat_late= 1
	tech_naval_mtg_primitive_naval_technology=1
  }
	add_equipment_to_stockpile = { type = infantry_equipment_pike_and_shot_0 amount = 120000 producer = QNG }
	add_equipment_to_stockpile = { type = uniform_equipment_0 amount = 120000 producer = QNG }
	add_equipment_to_stockpile = { type = infantry_equipment_rifle_0 amount = 50000 producer = ENG }
	add_equipment_to_stockpile = { type = cavalry_equipment_0 amount = 30000 producer = QNG }

	create_equipment_variant = {
		name = "Chinese Junk class"
		type = ship_hull_primitive_sailing_boat_2
		name_group = GER_CA_HISTORICAL
		parent_version = 0
		modules = {
			fixed_ship_battery_slot = ship_cannon_battery_0
			#fixed_ship_fire_control_system_slot = empty
			fixed_ship_engine_slot = ship_engine_primitive_sails_0
			#fixed_ship_armor_slot = empty
			mid_1_custom_slot = empty
			#front_1_custom_slot = empty
		}
	}
	create_equipment_variant = {
		name = "Confucius-class"
		type = ship_hull_gunboat_1
		name_group = GER_CA_HISTORICAL
		parent_version = 0
		modules={
			fixed_ship_battery_slot=ship_cannon_battery_1
			fixed_ship_engine_slot=ship_engine_steam_screw_gunboat
			fixed_ship_fire_control_system_slot=fire_control_system_0
			mid_1_custom_slot=ship_cannon_battery_1
			fixed_ship_armor_slot=ship_armor_capital_hardwood_0
		}
	}

  # POLITICAL LEADERS
	retire_character = QNG_Xianfeng_Emperor
	QNG_Tongzhi_Emperor = {
		add_country_leader_role = {
			Promote_leader = yes
			Country_leader = {
				ideology = absolutism
				expire = "1908.1.1"
				traits = {}			
			}
		}
		promote_character = {
			Ideology = absolutism
		}
		promote_character = yes
	}
}
